<template>
  <div>
    <Header />
    <router-view></router-view>
    <Footer />
  </div>
</template>
<script>
import Header from "@/components/Header";
import Footer from "@/components/Footer";
export default {
  name: "App",
  components: {
    Header,
    Footer
  },
  mounted(){
    //触发发送请求获取数据存储到vuex的state里，但此时vue的组件中还没有数据
    this.getCategoryList();
  },
  methods: {
    getCategoryList() {
      //触发actions调用
      this.$store.dispatch("getCategoryList");
    },
  }
};
</script>
<style lang = 'less' scoped>
</style>
